package day0522;

import java.util.Arrays;

public class Test4 {

    public static void main(String[] args) throws InterruptedException {
        test1();
    }

    static int[]  a={};
    private static void test1() throws InterruptedException {
        a = Arrays.copyOf(a, a.length + 1);
        a[a.length-1] = (int) (Math.random() * 1000);//给a数组最后一位放入一个小于1000的随机数
        System.out.println(Arrays.toString(a));//打印a数组元素
        Thread.sleep(1000);
    }

}
